import React from 'react'

class Handler extends React.Component {
  state = {
    count: 100
  }
  // 类的实例方式
  handleClick = () => {
    this.setState({
      count: this.state.count - 1
    })
  }
  render() {
    return (
      <div>
        <div>我是类组件</div>
        <p>{this.state.count}</p>
        <button onClick={this.handleClick}>点击改变状态</button>
      </div>
    )
  }
}

export default Handler